package com.rt.gptnext.data.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.rt.gptnext.common.bean.BaseEntity;
import com.rt.gptnext.data.enums.OpenaiCompletionRoleEnum;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author gaoyiyang
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
public class OpenaiCompletion extends BaseEntity<OpenaiCompletion> {

    @Column(columnDefinition = "bigint")
    private Long chatId;

    @Column(columnDefinition = "int")
    private Integer chatVersion = 1;

    @Enumerated(EnumType.STRING)
    @Column(columnDefinition = "varchar(10)")
    private OpenaiCompletionRoleEnum role;

    @Column(columnDefinition = "text")
    private String content;

    @Column(columnDefinition = "bigint")
    private Long questionId;

    /** 是否作画 */
    @Column(columnDefinition = "tinyint")
    private boolean draw;

    /** 问答ID */
    @Column(columnDefinition = "varchar(64)")
    private String qaId;

}
